package com.qcrud.core.type;

import java.sql.ResultSet;
import java.sql.SQLException;

public class IntegerTypeHandler implements TypeHandler<Integer> {

    @Override
    public Integer getResult(ResultSet rs, int index) throws SQLException {
        int result = rs.getInt(index);
        return result == 0 && rs.wasNull() ? null : result;
    }
}
